<%@ page import="cn.school.service.GradeService" %>
<%@ page import="java.util.List" %>
<%@ page import="cn.school.entity.Grade" %><%--
  Created by IntelliJ IDEA.
  User: ghost
  Date: 2019/12/5
  Time: 21:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table cellpadding="10">
    <form action="doPost.jsp" method="post">
        <tr><td><label>年级</label></td><td>
            <select name="gradeid">
            <%
                GradeService gs = new GradeService();
                List<Grade> list = gs.findAll();
                for(Grade g:list){
            %>
                <option value="<%=g.getId()%>"><%=g.getGname()%></option>
                <% }%>
            </select>
        </td></tr>
        <tr><td><label>课程名称</label></td><td><input type="text" name="subjectname" required></td></tr>
        <tr><td><label>课程时长</label></td><td><input type="text" name="classhour" required></td></tr>
        <tr><td colspan="1"><input type="submit" value="添加"></td></tr>
    </form>
</table>
</body>
</html>
